import request from '../utils/request';
import { API } from '../utils/config';

/**
 * 获取品牌列表
 * @returns 返回品牌列表数据
 */
export const getBrandList = () => {
  return request({
    url: `${API.CLASSES}/Brand`,
    method: 'GET',
    params: {
      order: 'sort',
      limit: 1000 // 增加limit参数，确保获取所有数据
    }
  });
};

/**
 * 创建品牌
 * @param data 品牌数据
 */
export const createBrand = (data: any) => {
  return request({
    url: `${API.CLASSES}/Brand`,
    method: 'POST',
    data
  });
};

/**
 * 更新品牌
 * @param id 品牌ID
 * @param data 品牌数据
 */
export const updateBrand = (id: string, data: any) => {
  return request({
    url: `${API.CLASSES}/Brand/${id}`,
    method: 'PUT',
    data
  });
};

/**
 * 删除品牌
 * @param id 品牌ID
 */
export const deleteBrand = (id: string) => {
  return request({
    url: `${API.CLASSES}/Brand/${id}`,
    method: 'DELETE'
  });
};

/**
 * 获取品牌详情
 * @param id 品牌ID
 */
export const getBrandDetail = (id: string) => {
  return request({
    url: `${API.CLASSES}/Brand/${id}`,
    method: 'GET'
  });
}; 